// import 'package:flutter/material.dart';
// import 'package:get/get.dart';

// class MyPledge extends StatelessWidget {
//   @override
//   Widget build(BuildContext context) {
//     return Scaffold(
//       appBar: AppBar(
//           backgroundColor: Color(0xffffffff),
//           title: Text('我的质押'),
//           centerTitle: true),
//           body: ListView(
//             children: [
//               TabBar(
//                 tabs: [

//               ])
//             ],
//           ),
//     );
//   }
// }

import 'package:flutter/material.dart';
import "package:get/get.dart";
import 'package:osg/controllers/custom_widget.dart';
 

class MyPledge extends StatefulWidget {
  const MyPledge({super.key});
  @override
  State<MyPledge> createState() => _HomePageState();
}

class _HomePageState extends State<MyPledge>
    with SingleTickerProviderStateMixin {
  late TabController _tabController;
  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 3, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
            backgroundColor: Color(0xffffffff),
            title: Text('我的质押'),
            centerTitle: true),
        body: Column(
          children: [
            TabBar(
                indicatorWeight: 3.0,
                labelPadding: EdgeInsets.symmetric(vertical: 5),
                indicatorSize: TabBarIndicatorSize.tab,
                labelColor: Color(0xff333333),
                unselectedLabelColor: Color(0xff999999),
                dividerColor: Color(0XFFF8F9FD),
                dividerHeight: 3,
                controller: _tabController,
                overlayColor: WidgetStateProperty.all(Colors.transparent),
                tabs: [
                  Text(
                    '全部',
                    style: TextStyle(fontSize: 12),
                  ),
                  Text(
                    '进行中',
                    style: TextStyle(fontSize: 12),
                  ),
                  Text(
                    '已赎回',
                    style: TextStyle(fontSize: 12),
                  ),
                ]),
              SizedBox(height: 15,),
                isdata(),

            Expanded(
            child: TabBarView(controller: _tabController, children: [

              for(var item in [])
              Column(
                children: [
                  Container(
                    margin: EdgeInsets.symmetric(horizontal: 15),
                    padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
                    decoration: BoxDecoration(
                        color: Color(0XFFF8F9FD),
                        borderRadius: BorderRadius.circular(15)),
                    child: Column(
                      children: [
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          children: [
                            Text('超现实元宇宙数字艺术展厅',
                                style: TextStyle(
                                    fontSize: 14, color: Color((0XFF0F172B)))),
                                    
                            Text('质押中',
                                style: TextStyle(
                                    fontSize: 12, color: Color((0XFF542AFF)))),
                          ],
                        ),
                         SizedBox(
                              height: 10,
                            ),
                        Row(
                          children: [
                            ClipRRect(
                              borderRadius:
                                  BorderRadius.circular(10.0), // 设置圆角大小
                              child: Image.asset(
                                'static/aaa.png',
                                width: 80,
                                height: 80,
                                fit: BoxFit.fill,
                              ),
                            ),
                            SizedBox(
                              width: 10,
                            ),
                            Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Row(
                                  children: [
                                    Text('质押周期',
                                        style: TextStyle(
                                            fontSize: 12,
                                            color: Color((0XFF999999)))),
                                    SizedBox(
                                      width: 5,
                                    ),
                                    Text('7天',
                                        style: TextStyle(
                                            fontSize: 12,
                                            color: Color(((0XFF0F172B))))),
                                  ],
                                ),
                                Row(
                                  children: [
                                    Text('质押收益',
                                        style: TextStyle(
                                            fontSize: 12,
                                            color: Color((0XFF999999)))),
                                    SizedBox(
                                      width: 5,
                                    ),
                                    Text('预计234 SP',
                                        style: TextStyle(
                                            fontSize: 12,
                                            color: Color(((0XFF0F172B))))),
                                  ],
                                ),
                                Row(
                                  children: [
                                    Text('赎回日期',
                                        style: TextStyle(
                                            fontSize: 12,
                                            color: Color((0XFF999999)))),
                                    SizedBox(
                                      width: 5,
                                    ),
                                    Text('2020-12-16 16:23:23',
                                        style: TextStyle(
                                            fontSize: 12,
                                            color: Color(((0XFF0F172B))))),
                                  ],
                                ),
                              ],
                            )
                          ],
                        ),
                        Row(
                          children: [
                            Expanded(child: SizedBox()
                            ),
                            Container(
                              padding: EdgeInsets.symmetric(horizontal: 10,vertical: 2),
                              decoration: BoxDecoration(
                                border: Border.all(color: Color(0XFF0F172B)),
                                borderRadius: BorderRadius.circular(25)
                              ),
                              child:Text('质押组合',style: TextStyle(fontSize: 12,color: Color((0XFF0F172B)))),
                            ),
                            Container(
                              margin: EdgeInsets.only(left: 10),
                              padding: EdgeInsets.symmetric(horizontal: 13,vertical: 2),
                              decoration: BoxDecoration(
                                border: Border.all(color: Color(0XFF0F172B)),
                                color: Color(0XFF0F172B),
                                borderRadius: BorderRadius.circular(25)
                              ),
                              child:Text('赎回',style: TextStyle(fontSize: 12,color: Color((0XFFFFFFFF)))),
                            ),
                          ],
                        )

                      ],
                      
                    ),
                  ),

                ],
              )
            ]))
          ],
        ));
  }
}
